<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino A2DP: src/A2DPVolumeControl.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Arduino A2DP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">A2DPVolumeControl.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment">//     http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment">//</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">// limitations under the License.</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="comment">//</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="comment">// Copyright 2020 Phil Schatzmann</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment">// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &quot;esp_log.h&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    <span class="keyword">struct </span>__attribute__((packed)) Frame {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>  int16_t channel1;  </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>  int16_t channel2;  </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>  Frame(<span class="keywordtype">int</span> v = 0) { channel1 = channel2 = v; }</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>  Frame(<span class="keywordtype">int</span> ch1, <span class="keywordtype">int</span> ch2) {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    channel1 = ch1;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    channel2 = ch2;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>  }</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>};</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="foldopen" id="foldopen00054" data-start="{" data-end="};">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html">   54</a></span><span class="keyword">class </span><a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#ab34c606f1df8c0c1bac5c3a54dc7bfd5">   59</a></span>  <a class="code hl_function" href="class_a2_d_p_volume_control.html#ab34c606f1df8c0c1bac5c3a54dc7bfd5">A2DPVolumeControl</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="foldopen" id="foldopen00066" data-start="{" data-end="}">
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a8f23bd37f10a58fd03cebe5d9b180802">   66</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_volume_control.html#a8f23bd37f10a58fd03cebe5d9b180802">update_audio_data</a>(uint8_t* data, uint16_t byteCount) {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    <a class="code hl_function" href="class_a2_d_p_volume_control.html#a8f23bd37f10a58fd03cebe5d9b180802">update_audio_data</a>((Frame*)data, byteCount / 4);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>  }</div>
</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span> </div>
<div class="foldopen" id="foldopen00075" data-start="{" data-end="}">
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a6eb1add5a68fe554c6705cb9fad25545">   75</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_volume_control.html#a6eb1add5a68fe554c6705cb9fad25545">update_audio_data</a>(Frame* data, uint16_t frameCount) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    <span class="keywordflow">if</span> (data != <span class="keyword">nullptr</span> &amp;&amp; frameCount &gt; 0 &amp;&amp; (<a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">mono_downmix</a> || <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">is_volume_used</a>)) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>      ESP_LOGD(<span class="stringliteral">&quot;VolumeControl&quot;</span>, <span class="stringliteral">&quot;update_audio_data&quot;</span>);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>      <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; frameCount; i++) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>        int32_t pcmLeft = data[i].channel1;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>        int32_t pcmRight = data[i].channel2;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>        <span class="comment">// if mono -&gt; we provide the same output on both channels</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>        <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">mono_downmix</a>) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>          pcmRight = pcmLeft = (pcmLeft + pcmRight) / 2;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>        }</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>        <span class="comment">// adjust the volume</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>        <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">is_volume_used</a>) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>          pcmLeft = <a class="code hl_function" href="class_a2_d_p_volume_control.html#a23700514ed3bb33151ea90033e8dcbea">clip</a>(pcmLeft * <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> / <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a>);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>          pcmRight = <a class="code hl_function" href="class_a2_d_p_volume_control.html#a23700514ed3bb33151ea90033e8dcbea">clip</a>(pcmRight * <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> / <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>        }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        data[i].channel1 = pcmLeft;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        data[i].channel2 = pcmRight;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>      }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    }</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>  }</div>
</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a6af31a3ffaad03ffa06930bbb3d3d285">  100</a></span>  int32_t <a class="code hl_function" href="class_a2_d_p_volume_control.html#a6af31a3ffaad03ffa06930bbb3d3d285">get_volume_factor</a>() { <span class="keywordflow">return</span> <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a>; }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#ae5ff3aa2b2b615e7eb01c8a8f164ef60">  106</a></span>  int32_t <a class="code hl_function" href="class_a2_d_p_volume_control.html#ae5ff3aa2b2b615e7eb01c8a8f164ef60">get_volume_factor_max</a>() { <span class="keywordflow">return</span> <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a>; }</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#abdb9256f6a30b6c716193af7fadeee9c">  112</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_volume_control.html#abdb9256f6a30b6c716193af7fadeee9c">set_enabled</a>(<span class="keywordtype">bool</span> enabled) { <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">is_volume_used</a> = enabled; }</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a533745afd59e80e2549c9dfa80e05423">  118</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_volume_control.html#a533745afd59e80e2549c9dfa80e05423">set_mono_downmix</a>(<span class="keywordtype">bool</span> enabled) { <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">mono_downmix</a> = enabled; }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a4a40e553f8c15a2cecb6f2f71fa0464c">  124</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_volume_control.html#a4a40e553f8c15a2cecb6f2f71fa0464c">set_volume</a>(uint8_t volume) = 0;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">  127</a></span>  <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">is_volume_used</a> = <span class="keyword">false</span>;  </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">  128</a></span>  <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">mono_downmix</a> = <span class="keyword">false</span>;    </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">  129</a></span>  int32_t <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = 1;     </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">  130</a></span>  int32_t <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a> = 0x1000;     </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">  131</a></span>  int32_t <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a> = 0xfff;  </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="class_a2_d_p_volume_control.html#a23700514ed3bb33151ea90033e8dcbea">  138</a></span>  int32_t <a class="code hl_function" href="class_a2_d_p_volume_control.html#a23700514ed3bb33151ea90033e8dcbea">clip</a>(int32_t value) {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    int32_t result = value;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>    <span class="keywordflow">if</span> (value &lt; -32768) result = -32768;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    <span class="keywordflow">if</span> (value &gt; 32767) result = 32767;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>  }</div>
</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>};</div>
</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="foldopen" id="foldopen00151" data-start="{" data-end="};">
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="class_a2_d_p_default_volume_control.html">  151</a></span><span class="keyword">class </span><a class="code hl_class" href="class_a2_d_p_default_volume_control.html">A2DPDefaultVolumeControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="class_a2_d_p_default_volume_control.html#add521bd19ecace9dde147b63ae92f642">  156</a></span>  <a class="code hl_function" href="class_a2_d_p_default_volume_control.html#add521bd19ecace9dde147b63ae92f642">A2DPDefaultVolumeControl</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span> </div>
<div class="foldopen" id="foldopen00163" data-start="{" data-end="}">
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"><a class="line" href="class_a2_d_p_default_volume_control.html#ad222275ea48c27f39b2fbcc6dbab62b4">  163</a></span>  <a class="code hl_function" href="class_a2_d_p_default_volume_control.html#ad222275ea48c27f39b2fbcc6dbab62b4">A2DPDefaultVolumeControl</a>(int32_t limit) {</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>    assert(limit &lt; <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a>);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a> = limit;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>  };</div>
</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> <span class="keyword">protected</span>:</div>
<div class="foldopen" id="foldopen00173" data-start="{" data-end="}">
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"><a class="line" href="class_a2_d_p_default_volume_control.html#ad4d0b24a939feda229bde29eb0c985e1">  173</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_default_volume_control.html#ad4d0b24a939feda229bde29eb0c985e1">set_volume</a>(uint8_t volume)<span class="keyword"> override </span>{</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>    <span class="keyword">constexpr</span> <span class="keywordtype">float</span> base = 1.4f;</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>    <span class="keyword">constexpr</span> <span class="keywordtype">float</span> bits = 12.0f;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>    <span class="keyword">constexpr</span> <span class="keywordtype">float</span> zero_ofs = pow(base, -bits);</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>    <span class="keyword">constexpr</span> <span class="keywordtype">float</span> scale = pow(2.0f, bits);</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>    <span class="keywordtype">float</span> volumeFactorFloat =</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>        (pow(base, volume * bits / 127.0f - bits) - zero_ofs) * scale /</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>        (1.0f - zero_ofs);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = volumeFactorFloat;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> &gt; <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a>) {</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>      <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a>;</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>    }</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>  }</div>
</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>};</div>
</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="foldopen" id="foldopen00193" data-start="{" data-end="};">
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"><a class="line" href="class_a2_d_p_simple_exponential_volume_control.html">  193</a></span><span class="keyword">class </span><a class="code hl_class" href="class_a2_d_p_simple_exponential_volume_control.html">A2DPSimpleExponentialVolumeControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> {</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"><a class="line" href="class_a2_d_p_simple_exponential_volume_control.html#a74bde67a7f5a5cfca68a2490d1b2521a">  198</a></span>  <a class="code hl_function" href="class_a2_d_p_simple_exponential_volume_control.html#a74bde67a7f5a5cfca68a2490d1b2521a">A2DPSimpleExponentialVolumeControl</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span> </div>
<div class="foldopen" id="foldopen00205" data-start="{" data-end="}">
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"><a class="line" href="class_a2_d_p_simple_exponential_volume_control.html#aec9a854d6fece1b84e767f6866ad01fc">  205</a></span>  <a class="code hl_function" href="class_a2_d_p_simple_exponential_volume_control.html#aec9a854d6fece1b84e767f6866ad01fc">A2DPSimpleExponentialVolumeControl</a>(int32_t limit) {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>    assert(limit &lt; <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a>);</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a> = limit;</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span>  };</div>
</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span> <span class="keyword">protected</span>:</div>
<div class="foldopen" id="foldopen00215" data-start="{" data-end="}">
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="class_a2_d_p_simple_exponential_volume_control.html#a2d3c9b6e1737bea85096ddc58c6cf853">  215</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_simple_exponential_volume_control.html#a2d3c9b6e1737bea85096ddc58c6cf853">set_volume</a>(uint8_t volume)<span class="keyword"> override </span>{</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    <span class="keywordtype">float</span> volumeFactorFloat = volume;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>    volumeFactorFloat = pow(2.0f, volumeFactorFloat * 12.0f / 127.0f);</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = volumeFactorFloat - 1.0f;</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> &gt; <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a>) {</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>      <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">volumeFactorClippingLimit</a>;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>    }</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>  }</div>
</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>};</div>
</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span> </div>
<div class="foldopen" id="foldopen00230" data-start="{" data-end="};">
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"><a class="line" href="class_a2_d_p_linear_volume_control.html">  230</a></span><span class="keyword">class </span><a class="code hl_class" href="class_a2_d_p_linear_volume_control.html">A2DPLinearVolumeControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"><a class="line" href="class_a2_d_p_linear_volume_control.html#a784b8d5266fac3d7f359785334de9c88">  235</a></span>  <a class="code hl_function" href="class_a2_d_p_linear_volume_control.html#a784b8d5266fac3d7f359785334de9c88">A2DPLinearVolumeControl</a>() { <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a> = 128; }</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span> </div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span> <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"><a class="line" href="class_a2_d_p_linear_volume_control.html#aa923e78a96352519ddca28bc957a73e0">  242</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_linear_volume_control.html#aa923e78a96352519ddca28bc957a73e0">set_volume</a>(uint8_t volume)<span class="keyword"> override </span>{ <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = volume; }</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>};</div>
</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span> </div>
<div class="foldopen" id="foldopen00250" data-start="{" data-end="};">
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="class_a2_d_p_no_volume_control.html">  250</a></span><span class="keyword">class </span><a class="code hl_class" href="class_a2_d_p_no_volume_control.html">A2DPNoVolumeControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a> {</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span> <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00257" data-start="{" data-end="}">
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"><a class="line" href="class_a2_d_p_no_volume_control.html#a6a6cb29be2611f9c409ff94e18cded7e">  257</a></span>  <a class="code hl_function" href="class_a2_d_p_no_volume_control.html#a6a6cb29be2611f9c409ff94e18cded7e">A2DPNoVolumeControl</a>(int32_t fixedVolume = 0x1000) {</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">is_volume_used</a> = fixedVolume != 0x1000;</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">mono_downmix</a> = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">volumeFactor</a> = fixedVolume;  <span class="comment">// fixed volume</span></div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>    <a class="code hl_variable" href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">volumeFactorMax</a> = 0x1000;  <span class="comment">// no change</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>  }</div>
</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span>  </div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"><a class="line" href="class_a2_d_p_no_volume_control.html#ab7e6d29791af0c5820679170838bc241">  269</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_no_volume_control.html#ab7e6d29791af0c5820679170838bc241">update_audio_data</a>(Frame* data, uint16_t frameCount)<span class="keyword"> override </span>{}</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span> </div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"><a class="line" href="class_a2_d_p_no_volume_control.html#a5c88fdd55a147303b6dcc53b5378e18b">  275</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="class_a2_d_p_no_volume_control.html#a5c88fdd55a147303b6dcc53b5378e18b">set_volume</a>(uint8_t volume)<span class="keyword"> override </span>{}</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>};</div>
</div>
<div class="ttc" id="aclass_a2_d_p_default_volume_control_html"><div class="ttname"><a href="class_a2_d_p_default_volume_control.html">A2DPDefaultVolumeControl</a></div><div class="ttdoc">Default implementation for handling of the volume of the audio data.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:151</div></div>
<div class="ttc" id="aclass_a2_d_p_default_volume_control_html_ad222275ea48c27f39b2fbcc6dbab62b4"><div class="ttname"><a href="class_a2_d_p_default_volume_control.html#ad222275ea48c27f39b2fbcc6dbab62b4">A2DPDefaultVolumeControl::A2DPDefaultVolumeControl</a></div><div class="ttdeci">A2DPDefaultVolumeControl(int32_t limit)</div><div class="ttdoc">Constructor with custom volume factor clipping limit.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:163</div></div>
<div class="ttc" id="aclass_a2_d_p_default_volume_control_html_ad4d0b24a939feda229bde29eb0c985e1"><div class="ttname"><a href="class_a2_d_p_default_volume_control.html#ad4d0b24a939feda229bde29eb0c985e1">A2DPDefaultVolumeControl::set_volume</a></div><div class="ttdeci">void set_volume(uint8_t volume) override</div><div class="ttdoc">Sets the volume using exponential curve calculation.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:173</div></div>
<div class="ttc" id="aclass_a2_d_p_default_volume_control_html_add521bd19ecace9dde147b63ae92f642"><div class="ttname"><a href="class_a2_d_p_default_volume_control.html#add521bd19ecace9dde147b63ae92f642">A2DPDefaultVolumeControl::A2DPDefaultVolumeControl</a></div><div class="ttdeci">A2DPDefaultVolumeControl()=default</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclass_a2_d_p_linear_volume_control_html"><div class="ttname"><a href="class_a2_d_p_linear_volume_control.html">A2DPLinearVolumeControl</a></div><div class="ttdoc">The simplest possible implementation of a VolumeControl.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:230</div></div>
<div class="ttc" id="aclass_a2_d_p_linear_volume_control_html_a784b8d5266fac3d7f359785334de9c88"><div class="ttname"><a href="class_a2_d_p_linear_volume_control.html#a784b8d5266fac3d7f359785334de9c88">A2DPLinearVolumeControl::A2DPLinearVolumeControl</a></div><div class="ttdeci">A2DPLinearVolumeControl()</div><div class="ttdoc">Constructor that sets volumeFactorMax to 128 for linear scaling.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:235</div></div>
<div class="ttc" id="aclass_a2_d_p_linear_volume_control_html_aa923e78a96352519ddca28bc957a73e0"><div class="ttname"><a href="class_a2_d_p_linear_volume_control.html#aa923e78a96352519ddca28bc957a73e0">A2DPLinearVolumeControl::set_volume</a></div><div class="ttdeci">void set_volume(uint8_t volume) override</div><div class="ttdoc">Sets the volume using direct linear mapping.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:242</div></div>
<div class="ttc" id="aclass_a2_d_p_no_volume_control_html"><div class="ttname"><a href="class_a2_d_p_no_volume_control.html">A2DPNoVolumeControl</a></div><div class="ttdoc">Keeps the audio data as is -&gt; no volume control!</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:250</div></div>
<div class="ttc" id="aclass_a2_d_p_no_volume_control_html_a5c88fdd55a147303b6dcc53b5378e18b"><div class="ttname"><a href="class_a2_d_p_no_volume_control.html#a5c88fdd55a147303b6dcc53b5378e18b">A2DPNoVolumeControl::set_volume</a></div><div class="ttdeci">void set_volume(uint8_t volume) override</div><div class="ttdoc">Override that does nothing - no volume setting.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:275</div></div>
<div class="ttc" id="aclass_a2_d_p_no_volume_control_html_a6a6cb29be2611f9c409ff94e18cded7e"><div class="ttname"><a href="class_a2_d_p_no_volume_control.html#a6a6cb29be2611f9c409ff94e18cded7e">A2DPNoVolumeControl::A2DPNoVolumeControl</a></div><div class="ttdeci">A2DPNoVolumeControl(int32_t fixedVolume=0x1000)</div><div class="ttdoc">Constructor with optional fixed volume setting.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:257</div></div>
<div class="ttc" id="aclass_a2_d_p_no_volume_control_html_ab7e6d29791af0c5820679170838bc241"><div class="ttname"><a href="class_a2_d_p_no_volume_control.html#ab7e6d29791af0c5820679170838bc241">A2DPNoVolumeControl::update_audio_data</a></div><div class="ttdeci">void update_audio_data(Frame *data, uint16_t frameCount) override</div><div class="ttdoc">Override that does nothing - no audio data modification.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:269</div></div>
<div class="ttc" id="aclass_a2_d_p_simple_exponential_volume_control_html"><div class="ttname"><a href="class_a2_d_p_simple_exponential_volume_control.html">A2DPSimpleExponentialVolumeControl</a></div><div class="ttdoc">Exponential volume control.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:193</div></div>
<div class="ttc" id="aclass_a2_d_p_simple_exponential_volume_control_html_a2d3c9b6e1737bea85096ddc58c6cf853"><div class="ttname"><a href="class_a2_d_p_simple_exponential_volume_control.html#a2d3c9b6e1737bea85096ddc58c6cf853">A2DPSimpleExponentialVolumeControl::set_volume</a></div><div class="ttdeci">void set_volume(uint8_t volume) override</div><div class="ttdoc">Sets the volume using simple exponential calculation.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:215</div></div>
<div class="ttc" id="aclass_a2_d_p_simple_exponential_volume_control_html_a74bde67a7f5a5cfca68a2490d1b2521a"><div class="ttname"><a href="class_a2_d_p_simple_exponential_volume_control.html#a74bde67a7f5a5cfca68a2490d1b2521a">A2DPSimpleExponentialVolumeControl::A2DPSimpleExponentialVolumeControl</a></div><div class="ttdeci">A2DPSimpleExponentialVolumeControl()=default</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclass_a2_d_p_simple_exponential_volume_control_html_aec9a854d6fece1b84e767f6866ad01fc"><div class="ttname"><a href="class_a2_d_p_simple_exponential_volume_control.html#aec9a854d6fece1b84e767f6866ad01fc">A2DPSimpleExponentialVolumeControl::A2DPSimpleExponentialVolumeControl</a></div><div class="ttdeci">A2DPSimpleExponentialVolumeControl(int32_t limit)</div><div class="ttdoc">Constructor with custom volume factor clipping limit.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:205</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html"><div class="ttname"><a href="class_a2_d_p_volume_control.html">A2DPVolumeControl</a></div><div class="ttdoc">Abstract class for handling of the volume of the audio data.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:54</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a23700514ed3bb33151ea90033e8dcbea"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a23700514ed3bb33151ea90033e8dcbea">A2DPVolumeControl::clip</a></div><div class="ttdeci">int32_t clip(int32_t value)</div><div class="ttdoc">Clips audio sample value to prevent overflow.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:138</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a4a40e553f8c15a2cecb6f2f71fa0464c"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a4a40e553f8c15a2cecb6f2f71fa0464c">A2DPVolumeControl::set_volume</a></div><div class="ttdeci">virtual void set_volume(uint8_t volume)=0</div><div class="ttdoc">Sets the volume level (pure virtual function)</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a533745afd59e80e2549c9dfa80e05423"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a533745afd59e80e2549c9dfa80e05423">A2DPVolumeControl::set_mono_downmix</a></div><div class="ttdeci">void set_mono_downmix(bool enabled)</div><div class="ttdoc">Enables or disables mono downmix.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:118</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a6af31a3ffaad03ffa06930bbb3d3d285"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a6af31a3ffaad03ffa06930bbb3d3d285">A2DPVolumeControl::get_volume_factor</a></div><div class="ttdeci">int32_t get_volume_factor()</div><div class="ttdoc">Gets the current volume factor.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:100</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a6eb1add5a68fe554c6705cb9fad25545"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a6eb1add5a68fe554c6705cb9fad25545">A2DPVolumeControl::update_audio_data</a></div><div class="ttdeci">virtual void update_audio_data(Frame *data, uint16_t frameCount)</div><div class="ttdoc">Updates audio data with volume control and optional mono downmix.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:75</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a7982efce1f1a1ab6c902900f8e0bb696"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a7982efce1f1a1ab6c902900f8e0bb696">A2DPVolumeControl::is_volume_used</a></div><div class="ttdeci">bool is_volume_used</div><div class="ttdoc">Flag indicating if volume control is enabled.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:127</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a8489e6a24ee9c9135ce42b7e4c686546"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a8489e6a24ee9c9135ce42b7e4c686546">A2DPVolumeControl::volumeFactorClippingLimit</a></div><div class="ttdeci">int32_t volumeFactorClippingLimit</div><div class="ttdoc">Volume factor clipping limit (4095)</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:131</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a8b449f76c7c931cf590732a3d73acaea"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a8b449f76c7c931cf590732a3d73acaea">A2DPVolumeControl::mono_downmix</a></div><div class="ttdeci">bool mono_downmix</div><div class="ttdoc">Flag indicating if mono downmix is enabled.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:128</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_a8f23bd37f10a58fd03cebe5d9b180802"><div class="ttname"><a href="class_a2_d_p_volume_control.html#a8f23bd37f10a58fd03cebe5d9b180802">A2DPVolumeControl::update_audio_data</a></div><div class="ttdeci">virtual void update_audio_data(uint8_t *data, uint16_t byteCount)</div><div class="ttdoc">Updates audio data with volume control and optional mono downmix.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:66</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_ab34c606f1df8c0c1bac5c3a54dc7bfd5"><div class="ttname"><a href="class_a2_d_p_volume_control.html#ab34c606f1df8c0c1bac5c3a54dc7bfd5">A2DPVolumeControl::A2DPVolumeControl</a></div><div class="ttdeci">A2DPVolumeControl()=default</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_abdb9256f6a30b6c716193af7fadeee9c"><div class="ttname"><a href="class_a2_d_p_volume_control.html#abdb9256f6a30b6c716193af7fadeee9c">A2DPVolumeControl::set_enabled</a></div><div class="ttdeci">void set_enabled(bool enabled)</div><div class="ttdoc">Enables or disables volume control.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:112</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_adc84ddb465e3fed9c0903a9f3e565be8"><div class="ttname"><a href="class_a2_d_p_volume_control.html#adc84ddb465e3fed9c0903a9f3e565be8">A2DPVolumeControl::volumeFactor</a></div><div class="ttdeci">int32_t volumeFactor</div><div class="ttdoc">Current volume factor.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:129</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_adf01b0f44d8f482ed5119f088958595e"><div class="ttname"><a href="class_a2_d_p_volume_control.html#adf01b0f44d8f482ed5119f088958595e">A2DPVolumeControl::volumeFactorMax</a></div><div class="ttdeci">int32_t volumeFactorMax</div><div class="ttdoc">Maximum volume factor (4096)</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:130</div></div>
<div class="ttc" id="aclass_a2_d_p_volume_control_html_ae5ff3aa2b2b615e7eb01c8a8f164ef60"><div class="ttname"><a href="class_a2_d_p_volume_control.html#ae5ff3aa2b2b615e7eb01c8a8f164ef60">A2DPVolumeControl::get_volume_factor_max</a></div><div class="ttdeci">int32_t get_volume_factor_max()</div><div class="ttdoc">Gets the maximum volume factor value.</div><div class="ttdef"><b>Definition</b> A2DPVolumeControl.h:106</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
